﻿using Learun.Util;
using System;
using System.Collections.Generic;

namespace Learun.Application.TwoDevelopment.ZZDT_EC
{
    /// <summary>
    /// 版 本 PIT-ADMS V7.0.3 敏捷开发框架
    /// Copyright (c) 2013-2018 Hexagon PPM
    /// 创 建：超级管理员
    /// 日 期：2022-03-14 10:56
    /// 描 述：对象类型元件库
    /// </summary>
    public class ec_objecttypelibBLL : ec_objecttypelibIBLL
    {
        private ec_objecttypelibService ec_objecttypelibService = new ec_objecttypelibService();

        #region 获取数据

        /// <summary>
        /// 获取对象类型元件库表数据
        /// <summary>
        /// <param name="objectTypeID">对象类型ID</param>
        /// <param name="ProjectId">项目ID</param>
        /// <returns></returns>
        public IEnumerable<ec_objecttypelibEntity> GetObjectTypeLib(string objectTypeID, string ProjectId)
        {
            try
            {
                return ec_objecttypelibService.GetObjectTypeLib(objectTypeID, ProjectId);
            }
            catch (Exception ex)
            {
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowBusinessException(ex);
                }
            }
        }
        #endregion

        #region 提交数据

        /// <summary>
        /// 保存实体数据（新增、修改）
        /// <summary>
        /// <returns></returns>
        public void SaveObjectTypeLib(string objectTypeID, List<ec_objecttypelibEntity> entityList, string ProjectId)
        {
            try
            {
                ec_objecttypelibService.SaveObjectTypeLib(objectTypeID, entityList, ProjectId);
            }
            catch (Exception ex)
            {
                if (ex is ExceptionEx)
                {
                    throw;
                }
                else
                {
                    throw ExceptionEx.ThrowBusinessException(ex);
                }
            }
        }

        #endregion

    }
}
